more descriptive representation of installed memory in summary table#592
Merged
harp-intel merged 1 commit intomainfrom Dec 16, 2025
Merged
more descriptive representation of installed memory in summary table#592harp-intel merged 1 commit intomainfrom
harp-intel merged 1 commit intomainfrom
Conversation
Signed-off-by: Harper, Jason M <jason.m.harper@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors DIMM (memory module) information handling by centralizing parsing logic and index constants into the internal/common package. The main purpose is to improve code maintainability and reduce duplication across the codebase.
Key changes:
- Moved DIMM index constants and helper functions from
cmd/report/dimm.gotointernal/common/table_helpers.gofor reuse - Enhanced the brief summary table to prioritize DIMM information from DMI decode over
/proc/meminfo - Updated all references throughout the codebase to use the centralized
common.DimmInfoFromDmiDecodeandcommon.InstalledMemoryFromOutputfunctions
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/common/table_helpers.go | Added DIMM index constants and helper functions (DimmInfoFromDmiDecode, InstalledMemoryFromOutput) moved from cmd/report/dimm.go |
| internal/common/table_defs.go | Updated brief summary table to prefer DIMM info from DMI decode with fallback to meminfo, changed field name to "Memory" |
| cmd/report/system.go | Updated to use common.InstalledMemoryFromOutput instead of local function |
| cmd/report/report_tables.go | Updated table value functions and HTML renderer to use common DIMM constants and helper functions |
| cmd/report/dimm.go | Removed local DIMM constants and helper functions, updated all references to use common package versions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request refactors how DIMM (memory module) information is handled and accessed throughout the codebase. The main change is moving the DIMM index constants and related helper functions from
cmd/report/dimm.goto theinternal/commonpackage, making them reusable and centralizing DIMM parsing logic. All code that previously used local DIMM helpers and constants now references the shared versions ininternal/common. This improves maintainability and reduces code duplication.Key changes include:
Improvements to Summary Table Logic:
internal/common/table_defs.goto prefer DIMM information from DMI decode, falling back to/proc/meminfoonly if necessary, and updated the field name to "Memory" for clarity. [1] [2]Refactoring and Code Reuse:
BankLocatorIdx,SizeIdx, etc.) and DIMM helper functions (DimmInfoFromDmiDecode,InstalledMemoryFromOutput) fromcmd/report/dimm.gotointernal/common/table_helpers.gofor shared use across the codebase. [1] [2]Code Updates to Use Shared Helpers:
cmd/report/dimm.goto usecommon.DimmInfoFromDmiDecodeandcommon.<IndexConstant>instead of local definitions. [1] [2] [3] [4] [5] [6]cmd/report/report_tables.goandcmd/report/system.goto usecommon.InstalledMemoryFromOutputandcommon.<IndexConstant>. [1] [2] [3] [4]These changes centralize DIMM parsing logic, reduce duplication, and ensure consistency across different parts of the codebase when handling memory module information.